package com.mochasoft.shangchm.analyzer;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class JOAnalyzer implements Analyzer {

	public boolean isBad(TreeSet group) {
		int i = osize(group);
		if(i==2){
			System.out.println("奇偶比例:"+"4:"+i);
			return false;
		}else if(i==3){
			System.out.println("奇偶比例:"+"3:"+i);
			return false;
		}else{
			return true;
		}
		
	}
	
	private int osize(Set group){
		int i = 0;
		for (Iterator iter = group.iterator(); iter.hasNext();) {
			int ball = (Integer)iter.next();
			if(ball%2==0){
				i++;
			}
		}
		return i;
	}

}
